package com.wujunshen.rest.bean;

import lombok.Data;

@Data
public class ResponseResult implements java.io.Serializable {

    // 返回消息
    private String msg = "";

    // 结果数据
    private Object data = "";

    //成功或失败标志位
    private boolean success = true;

    public static ResponseResult success() {
        return new ResponseResult();
    }

    public static ResponseResult success(Object responseData) {
        ResponseResult result = new ResponseResult();
        result.setData(responseData);
        return result;
    }

    public static ResponseResult error() {
        ResponseResult result = new ResponseResult();
        result.setSuccess(false);
        return result;
    }

    public static ResponseResult error(String message) {
        ResponseResult result = new ResponseResult();
        result.setMsg(message);
        return result;
    }

}
